package com.hmkj.admin.controller.index;

import com.hmkj.admin.controller.BaseController;
import com.xiaoleilu.hutool.date.DateUtil;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class IndexController extends BaseController {


    @RequestMapping(value = BASE_URI, method = RequestMethod.GET)
    public String index(ModelMap modelMap) throws Exception {
        modelMap.put("statTime", DateUtil.now());
//        //查询昨天下单金额、下单量、新增会员、新增店铺、新增商品数
//        HashMap<String,Object> statHoursMap = statHoursDao.findStatHoursSumByDate(sTime, eTime);
//        modelMap.put("statHoursMap", statHoursMap);
//        //商品总数
//        long goodsCommonCount = goodsCommonDao.findCount(GoodsCommon.class);
//        modelMap.put("goodsCommonCount", goodsCommonCount);
//        //店铺总数
//        long storeCount = storeDao.findCount(Store.class);
//        modelMap.put("storeCount", storeCount);
//        //会员总数
//        long memberCount = memberDao.findCount(Member.class);
//        modelMap.put("memberCount", memberCount);

        modelMap.put("update", "11111122222333");
        return ok("index");
    }

    @RequestMapping(value = "/", method = RequestMethod.GET)
    public ModelAndView index() throws Exception {
        return new ModelAndView("redirect:" + BASE_URI);
    }


}